<?php 
global $base_url;

if(arg(0) == 'node' and (!is_null(arg(1))) ){
    $nid = arg(1);
    
    $node = node_load($nid);
    $uri_img_topo = $node->field_imagem_topo['und'][0]['uri'];
    $arr_tmp01 = explode('public://', $uri_img_topo);
    $nome_img_topo = $arr_tmp01[1];
}else{
    $nome_img_topo = 'institucional.jpg';
}

$main_menu = menu_tree('menu-sub-slide-padrao');

$contador = 0;
foreach ($main_menu as $strChave => $item) {
    
    if ($strChave == "#sorted" || $strChave == "#theme_wrappers")
        continue;

    $nome_item = $item['#title'];

    $url_item = drupal_get_path_alias($item['#href']);
                    
    $menu[$contador]["titulo"]  = $nome_item;
    $menu[$contador]["url"]     = $url_item;
                        
    $contador++;
}

$strLink = consultorOnline();
?>

<div class="i-slider" style="background-image:url('/sites/default/files/<?php print $nome_img_topo;?>')">
    <!-- <img src="/sites/default/files/<?php //print $nome_img_topo;?>" align="center"> -->
</div>

<div class="quick-access">
    <div class="container">
        <div class="row">
            <div class="col-md-11 col-lg-offset-1">
                <ul class="btn-n">
                    <li class="phone"><a href="<?= $base_url ?>/<?php print $menu[2]["url"]; ?>">Ligamos pra você</a></li>
                    <li class="mailing"><a href="<?= $base_url ?>/<?php print $menu[0]["url"]; ?>">Atendimento por e-mail</a></li>
                    <li class="consultant"><a href="<?php print $strLink; ?>">Consultor online</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
